home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Applications / Alpha.5.96 folder / Tcl / SystemCode / latexMenu.tcl < prev    next >
Encoding:
Text File  |  1994-09-21  |  10.5 KB  |  698 lines  |  [TEXT/ALFA]

  1. #############################################################################
  2. #############################################################################
  3. #
  4. # LaTeX Menu Definition (called from latex.tcl)
  5. #
  6. #############################################################################
  7. #
  8. # Author:  Tom Scavo (trscavo@syr.edu)
  9. #
  10. #############################################################################
  11. #############################################################################
  12.  
  13. proc interpretMenuItem {menu item} {
  14.     switch $item {
  15.         "Typeset"  {set func "typeset"}
  16.         "LaTeX"  {set func "latex"}
  17.         "BibTeX"  {set func "bibtex"}
  18.         "MakeIndex"  {set func "makeindex"}
  19.         {Next Tab Stop}  {set func "nextTabStop"}
  20.         {Prev Tab Stop}  {set func "prevTabStop"}
  21.         {nth Tab Stop}  {set func {nthTabStop 0}}
  22.         {Next Section}  {set func "nextSection"}
  23.         {Prev Section}  {set func "prevSection"}
  24.         {Next Subsection}  {set func "nextSubsection"}
  25.         {Prev Subsection}  {set func "prevSubsection"}
  26.         "list"  {set func "myList"}
  27.         "array"  {set func "myArray"}
  28.         "eqnarray\*"  {set func "eqnarrayStar"}
  29.         "ellipsis"  {set func "ldots"}
  30.         {TeX logo}  {set func "texLogo"}
  31.         {LaTeX logo}  {set func "latexLogo"}
  32.         {LaTeX2e logo}  {set func "latex2eLogo"}
  33.         "date"  {set func "today"}
  34.         {dag †}  {set func "dag"}
  35.         {section mark §}  {set func "sectionMark"}
  36.         {paragraph mark ¶}  {set func "paragraphMark"}
  37.         {copyright ©}  {set func "copyright"}
  38.         {pounds £}  {set func "pounds"}
  39.         {double quotes}  {set func "dblQuotes"}
  40.         {marginal note}  {set func "marginalNote"}
  41.         {TeX math}  {set func "texMath"}
  42.         {TeX displaymath}  {set func "texDisplaymath"}
  43.         {LaTeX math}  {set func "latexMath"}
  44.         {LaTeX displaymath}  {set func "latexDisplaymath"}
  45.         {blackboard bold} {set func "blackboardBold"}
  46.         {square root}  {set func "squareRoot"}
  47.         {nth root}  {set func "nthRoot"}
  48.         {one parameter}  {set func "oneParameter"}
  49.         {two parameters}  {set func "twoParameters"}
  50.         {pm ±}  {set func "pm"}
  51.         {div ÷}  {set func "div"}
  52.         {leq ≤}  {set func "leq"}
  53.         {ll «}  {set func "myLl"}
  54.         {geq ≥}  {set func "geq"}
  55.         {gg »}  {set func "gg"}
  56.         {approx ≈}  {set func "approx"}
  57.         {neq ≠}  {set func "neq"}
  58.         {join}  {set func "myJoin"}
  59.         {neg ¬}  {set func "neg"}
  60.         {partial ∂}  {set func "partial"}
  61.         {infty ∞}  {set func "infty"}
  62.         {vertical bars}  {set func "absoluteValue"}
  63.         {other delims}  {set func "otherDelims"}
  64.         {half-open interval}  {set func "half-openInterval"}
  65.         {half-closed interval}  {set func "half-closedInterval"}
  66.         {big parentheses}  {set func "bigParentheses"}
  67.         {big brackets}  {set func "bigBrackets"}
  68.         {big braces}  {set func "bigBraces"}
  69.         {big vertical bars}  {set func "bigAbsoluteValue"}
  70.         {other big delims}  {set func "otherBigDelims"}
  71.         {big left brace}  {set func "bigLeftBrace"}
  72.         {other mixed big delims}  {set func "otherMixedBigDelims"}
  73.         {neg thin} {set func "negThin"}
  74.         default {set func $item}
  75.     }
  76.     eval $func
  77. }
  78.  
  79. proc buildLaTeXMenu {} {
  80.     global latexMenu
  81.  
  82.     menu -n $latexMenu -m  {
  83.     
  84.         "/TTypeset"
  85.         
  86.         {menu -n Goto -m -p interpretMenuItem {
  87.             "/-LaTeX"
  88.             "BibTeX"
  89.             "MakeIndex"
  90.             "(-"
  91.             {Next Tab Stop}
  92.             {Prev Tab Stop}
  93.             {nth Tab Stop…}
  94.             "(-"
  95.             {Next Section}
  96.             {Prev Section}
  97.             {Next Subsection}
  98.             {Prev Subsection}
  99.             }
  100.         }
  101.         
  102.         {menu -n {LaTeX Utilities} -p interpretMenuItem {
  103.             clearTabStops
  104.             convertDollarSigns
  105.             "(-"
  106.             loadSymbolPackage
  107.             }
  108.         }
  109.         
  110.         "(-"
  111.         
  112.         {menu -n Documents -m -p interpretMenuItem {
  113.             "letter"
  114.             "article"
  115.             "report"
  116.             "book"
  117.             "slides"
  118.             "custom…"
  119.             "(-"
  120.             "styles…"
  121.             "packages…"
  122.             "(-"
  123.             "(filecontents…"
  124.             }
  125.         }
  126.         
  127.         {menu -n {Page Layout} -m -p interpretMenuItem {
  128.             "maketitle"
  129.             "(-"
  130.             "abstract"
  131.             "titlepage"
  132.             "(-"
  133.             "pagestyle…"
  134.             "thispagestyle…"
  135.             "pagenumbering…"
  136.             "(-"
  137.             "twocolumn"
  138.             "onecolumn"
  139.             }
  140.         }
  141.         
  142.         {menu -n Sectioning -m -p interpretMenuItem {
  143.             "part"
  144.             "chapter"
  145.             "section"
  146.             "subsection"
  147.             "subsubsection"
  148.             "paragraph"
  149.             "subparagraph"
  150.             "(-"
  151.             "appendix"
  152.             }
  153.         }
  154.         
  155.         "(-"
  156.         
  157.         {menu -n {Text Style} -m -p interpretMenuItem {
  158.             "emph"
  159.             "underline"
  160.             "(-"
  161.             "textup"
  162.             "textit"
  163.             "textsl"
  164.             "textsc"
  165.             "(-"
  166.             "textmd"
  167.             "textbf"
  168.             "(-"
  169.             "textrm"
  170.             "textsf"
  171.             "texttt"
  172.             "(-"
  173.             "textnormal"
  174.             }
  175.         }
  176.         
  177.         {menu -n {Text Size} -m -p interpretMenuItem {
  178.             "tiny"
  179.             "scriptsize"
  180.             "footnotesize"
  181.             "small"
  182.             "normalsize"
  183.             "large"
  184.             "Large"
  185.             "LARGE"
  186.             "huge"
  187.             "Huge"
  188.             }
  189.         }
  190.         
  191.         {menu -n International -p interpretMenuItem {
  192.             {ò}
  193.             {ó}
  194.             {ô}
  195.             {ö}
  196.             {õ}
  197.             {ç}
  198.             "(-"
  199.             {œ}
  200.             {Œ}
  201.             {æ}
  202.             {Æ}
  203.             {å}
  204.             {Å}
  205.             {ø}
  206.             {Ø}
  207.             {ß}
  208.             {¿}
  209.             {¡}
  210.             }
  211.         }
  212.         
  213.         {menu -n Environments -m -p interpretMenuItem {
  214.             "enumerate…"
  215.             "itemize…"
  216.             "description…"
  217.             "thebibliography…"
  218.             "(-"
  219.             "slide"
  220.             "overlay"
  221.             "note"
  222.             "(-"
  223.             "figure"
  224.             "table"
  225.             "tabular…"
  226.             "(-"
  227.             "verbatim"
  228.             "quote"
  229.             "quotation"
  230.             "verse"
  231.             "(-"
  232.             "flushleft"
  233.             "center"
  234.             "flushright"
  235.             "(-"
  236.             "general…"
  237.             }
  238.         }
  239.         
  240.         {menu -n Boxes -m -p interpretMenuItem {
  241.             "mbox"
  242.             "makebox"
  243.             "fbox"
  244.             "framebox"
  245.             "(-"
  246.             "newsavebox"
  247.             "sbox"
  248.             "savebox"
  249.             "usebox"
  250.             "(-"
  251.             "raisebox"
  252.             "(-"
  253.             "parbox"
  254.             "minipage"
  255.             "(-"
  256.             "rule"
  257.             }
  258.         }
  259.         
  260.         {menu -n Miscellaneous -m -p interpretMenuItem {
  261.             "ellipsis"
  262.             "en-dash"
  263.             "em-dash"
  264.             {TeX logo}
  265.             {LaTeX logo}
  266.             {LaTeX2e logo}
  267.             "date"
  268.             "(-"
  269.             {dag †}
  270.             "ddag"
  271.             {section mark §}
  272.             {paragraph mark ¶}
  273.             {copyright ©}
  274.             {pounds £}
  275.             "(-"
  276.             "quotes"
  277.             {double quotes}
  278.             "(-"
  279.             {marginal note}
  280.             "footnote"
  281.             "(-"
  282.             "label"
  283.             "ref"
  284.             "pageref"
  285.             "cite"
  286.             "(-"
  287.             "item"
  288.             "bibitem"
  289.             }
  290.         }
  291.         
  292.         "(-"
  293.         
  294.         {menu -n {Math Modes} -m -p interpretMenuItem {
  295.             {TeX math}
  296.             {TeX displaymath}
  297.             "(-"
  298.             {LaTeX math}
  299.             {LaTeX displaymath}
  300.             }
  301.         }
  302.         
  303.         {menu -n {Math Style} -m -p interpretMenuItem {
  304.             "mathit"
  305.             "mathrm"
  306.             "mathbf"
  307.             "mathsf"
  308.             "mathtt"
  309.             "mathcal"
  310.             "(-"
  311.             "displaystyle"
  312.             "textstyle"
  313.             "scriptstyle"
  314.             "scriptscriptstyle"
  315.             }
  316.         }
  317.         
  318.         {menu -n {Math Environments} -m -p interpretMenuItem {
  319.             "math"
  320.             "displaymath"
  321.             "equation"
  322.             "(-"
  323.             "array…"
  324.             "eqnarray*…"
  325.             "eqnarray…"
  326.             "(-"
  327.             "general…"
  328.             }
  329.         }
  330.         
  331.         {menu -n Formulas -m -p interpretMenuItem {
  332.             "subscript"
  333.             "superscript"
  334.             "fraction"
  335.             {square root}
  336.             {nth root}
  337.             "(-"
  338.             {one parameter…}
  339.             {two parameters…}
  340.             }
  341.         }
  342.     
  343.         {menu -n Greek -m -p interpretMenuItem {
  344.             "alpha"
  345.             "beta"
  346.             "gamma"
  347.             "delta"
  348.             "epsilon"
  349.             "zeta"
  350.             "eta"
  351.             "theta"
  352.             "iota"
  353.             "kappa"
  354.             "lambda"
  355.             "mu"
  356.             "nu"
  357.             "xi"
  358.             "omicron"
  359.             "pi"
  360.             "rho"
  361.             "sigma"
  362.             "tau"
  363.             "upsilon"
  364.             "phi"
  365.             "chi"
  366.             "psi"
  367.             "omega"
  368.             "(-"
  369.             "Gamma"
  370.             "Delta"
  371.             "Theta"
  372.             "Lambda"
  373.             "Xi"
  374.             "Pi"
  375.             "Sigma"
  376.             "Upsilon"
  377.             "Phi"
  378.             "Psi"
  379.             "Omega"
  380.             "(-"
  381.             "varepsilon"
  382.             "vartheta"
  383.             "varpi"
  384.             "varrho"
  385.             "varsigma"
  386.             "varphi"
  387.             }
  388.         }
  389.             
  390.         {menu -n {Binary Operators} -m -p interpretMenuItem {
  391.             {pm ±}
  392.             "mp"
  393.             "times"
  394.             {div ÷}
  395.             "ast"
  396.             "star"
  397.             "circ"
  398.             "bullet"
  399.             "cdot"
  400.             "cap"
  401.             "cup"
  402.             "uplus"
  403.             "sqcap"
  404.             "sqcup"
  405.             "vee"
  406.             "wedge"
  407.             "setminus"
  408.             "(-"
  409.             "diamond"
  410.             "bigtriangleup"
  411.             "bigtriangledown"
  412.             "triangleleft"
  413.             "triangleright"
  414.             "lhd"
  415.             "rhd"
  416.             "unlhd"
  417.             "unrhd"
  418.             "(-"
  419.             "oplus"
  420.             "ominus"
  421.             "otimes"
  422.             "oslash"
  423.             "odot"
  424.             "(-"
  425.             "bigcirc"
  426.             "dagger"
  427.             "ddagger"
  428.             "amalg"
  429.             "wr"
  430.             }
  431.         }
  432.         
  433.         {menu -n Relations -m -p interpretMenuItem {
  434.             {leq ≤}
  435.             "prec"
  436.             "preceq"
  437.             {ll «}
  438.             "subset"
  439.             "subseteq"
  440.             "sqsubset"
  441.             "sqsubseteq"
  442.             "in"
  443.             "vdash"
  444.             "(-"
  445.             {geq ≥}
  446.             "succ"
  447.             "succeq"
  448.             {gg »}
  449.             "supset"
  450.             "supseteq"
  451.             "sqsupset"
  452.             "sqsupseteq"
  453.             "ni"
  454.             "dashv"
  455.             "(-"
  456.             "equiv"
  457.             "sim"
  458.             "simeq"
  459.             "asymp"
  460.             {approx ≈}
  461.             "cong"
  462.             {neq ≠}
  463.             "doteq"
  464.             "propto"
  465.             "(-"
  466.             "models"
  467.             "perp"
  468.             "mid"
  469.             "parallel"
  470.             "bowtie"
  471.             "join"
  472.             "smile"
  473.             "frown"
  474.             }
  475.         }
  476.         
  477.         {menu -n Arrows -m -p interpretMenuItem {
  478.             "leftarrow"
  479.             "Leftarrow"
  480.             "rightarrow"
  481.             "Rightarrow"
  482.             "leftrightarrow"
  483.             "Leftrightarrow"
  484.             "mapsto"
  485.             "(-"
  486.             "longleftarrow"
  487.             "Longleftarrow"
  488.             "longrightarrow"
  489.             "Longrightarrow"
  490.             "longleftrightarrow"
  491.             "Longleftrightarrow"
  492.             "longmapsto"
  493.             "(-"
  494.             "hookleftarrow"
  495.             "hookrightarrow"
  496.             "leftharpoonup"
  497.             "rightharpoonup"
  498.             "leftharpoondown"
  499.             "rightharpoondown"
  500.             "rightleftharpoons"
  501.             "leadsto"
  502.             "(-"
  503.             "uparrow"
  504.             "Uparrow"
  505.             "downarrow"
  506.             "Downarrow"
  507.             "updownarrow"
  508.             "Updownarrow"
  509.             "(-"
  510.             "nearrow"
  511.             "searrow"
  512.             "swarrow"
  513.             "nwarrow"
  514.             }
  515.         }
  516.         
  517.         {menu -n Dots -m -p interpretMenuItem {
  518.             "bullet"
  519.             "cdot"
  520.             "(-"
  521.             "ldots"
  522.             "cdots"
  523.             "vdots"
  524.             "ddots"
  525.             }
  526.         }
  527.         
  528.         {menu -n Symbols -m -p interpretMenuItem {
  529.             "aleph"
  530.             "hbar"
  531.             "imath"
  532.             "jmath"
  533.             "ell"
  534.             "wp"
  535.             "Re"
  536.             "Im"
  537.             "mho"
  538.             "(-"
  539.             "angle"
  540.             "backslash"
  541.             "bot"
  542.             "emptyset"
  543.             "exists"
  544.             "forall"
  545.             {infty ∞}
  546.             "nabla"
  547.             {neg ¬}
  548.             {partial ∂}
  549.             "prime"
  550.             "surd"
  551.             "top"
  552.             "(-"
  553.             "Box"
  554.             "Diamond"
  555.             "triangle"
  556.             "clubsuit"
  557.             "diamondsuit"
  558.             "heartsuit"
  559.             "spadesuit"
  560.             "(-"
  561.             "flat"
  562.             "natural"
  563.             "sharp"
  564.             }
  565.         }
  566.             
  567.         {menu -n Functions -m -p interpretMenuItem {
  568.             "arccos"
  569.             "arcsin"
  570.             "arctan"
  571.             "arg"
  572.             "cos"
  573.             "cosh"
  574.             "cot"
  575.             "coth"
  576.             "csc"
  577.             "deg"
  578.             "det"
  579.             "dim"
  580.             "exp"
  581.             "gcd"
  582.             "hom"
  583.             "inf"
  584.             "ker"
  585.             "lg"
  586.             "lim"
  587.             "liminf"
  588.             "limsup"
  589.             "ln"
  590.             "log"
  591.             "max"
  592.             "min"
  593.             "Pr"
  594.             "sec"
  595.             "sin"
  596.             "sinh"
  597.             "sup"
  598.             "tan"
  599.             "tanh"
  600.             "(-"
  601.             "bmod"
  602.             "pmod"
  603.             }
  604.         }
  605.     
  606.         {menu -n {Large Operators} -m -p interpretMenuItem {
  607.             "sum"
  608.             "prod"
  609.             "coprod"
  610.             "int"
  611.             "oint"
  612.             "bigcap"
  613.             "bigcup"
  614.             "bigsqcap"
  615.             "bigsqcup"
  616.             "bigvee"
  617.             "bigwedge"
  618.             "bigodot"
  619.             "bigotimes"
  620.             "bigoplus"
  621.             "biguplus"
  622.             }
  623.         }
  624.         
  625.         {menu -n Delimiters -m -p interpretMenuItem {
  626.             "parentheses"
  627.             "brackets"
  628.             "braces"
  629.             {vertical bars}
  630.             {other delims…}
  631.             "(-"
  632.             {half-open interval}
  633.             {half-closed interval}
  634.             "(-"
  635.             {big parentheses}
  636.             {big brackets}
  637.             {big braces}
  638.             {big vertical bars}
  639.             {other big delims…}
  640.             "(-"
  641.             {big left brace}
  642.             {other mixed big delims…}
  643.             }
  644.         }
  645.             
  646.         {menu -n {Math Accents} -m -p interpretMenuItem {
  647.             "acute"
  648.             "bar"
  649.             "breve"
  650.             "check"
  651.             "ddot"
  652.             "dot"
  653.             "grave"
  654.             "hat"
  655.             "tilde"
  656.             "vec"
  657.             "(-"
  658.             "widehat"
  659.             "widetilde"
  660.             "(-"
  661.             "imath"
  662.             "jmath"
  663.             }
  664.         }
  665.         
  666.         {menu -n Grouping -m -p interpretMenuItem {
  667.             "underline"
  668.             "overline"
  669.             "underbrace"
  670.             "overbrace"
  671.             "(-"
  672.             "stackrel"
  673.             }
  674.         }
  675.         
  676.         {menu -n Spacing -m -p interpretMenuItem {
  677.             {neg thin}
  678.             "thin"
  679.             "medium"
  680.             "thick"
  681.             "(-"
  682.             "quad"
  683.             "qquad"
  684.             "(-"
  685.             "hspace"
  686.             "vspace"
  687.             "(-"
  688.             "hfill"
  689.             "vfill"
  690.             "(-"
  691.             "smallskip"
  692.             "medskip"
  693.             "bigskip"
  694.             }
  695.         }
  696.     }
  697. }
  698.